/*
 * atoi convert s to integer
 */

#include <stdio.h>
#include <ctype.h>

double atof(char* a_string)
{
  double val, power;
  int i, sign;

  for (i = 0; isspace(a_string[i]); ++i);
  sign = (a_string[i] == '-' ? -1 : 1;
  if (a_string[i] == '+' || a_string[i] == '-'){
    ++i;
  }
  for (val = 0.0; isdigit(a_string[i]); ++i){
    val = 10.0 * val + (a_string[i] - '0');
  }
          if (a_string[i] == '.'){
            ++i;
          }
          for (power = 1.0; isdigit(a_string[i]); ++i){
            val = 10.0  * val + (a_string[i] - '0');
            power * = 10;
          }
          return sign * val / power;
}

int atoi(char* a_string)
{
    int i;
    int n;
    int sign;

    for (i = 0; isspace(a_string[i]); ++i){;}

    sign = (a_string[i] == '-') ? -1 : 1;
    if (a_string[i] == '+' || a_string[i] == '-'){
       ++i;
    }
    for ( n = 0; isdigit(a_string[i]); ++i){
      n = 10 * n + (a_string[i] - '0');
    }
return sign * n;
     
}

void getline (char* s, int lim)  
{
	int i = 0;
	int c = 0;

	for (i=0; i < lim-1 && (c = getchar()) != 'Q'; ++i){
          s[i] = c;
        }
        s[++i] = '\0';

}

int main (int argc, const char** argv){
	int test = 0;
	int max = 100;
	char line[max];

	getline(line,max);
        test = atoi(line);  
        
        printf ("%d\n", test);
        return 0;
}
